package com.sg.business.permission.adapter.visitor;

import com.sg.business.model.Organization;
import com.sg.business.model.Role;
import com.sg.business.permission.model.PermissionVisitorFactory;
import com.sg.business.resource.nls.Messages;

public class RoleVisitorFactory extends PermissionVisitorFactory {

	private Role role;

	public RoleVisitorFactory(Role role) {
		this.role = role;
	}

	protected String getName() {
		String label =  "[" + Messages.get().OrganizationRole + "] " + role.getLabel();
		Organization org = role.getOrganization();
		label += " (" + org.getPath() + ")";
		return label;
	}

	protected String getType() {
		return ORGANIZATION_ROLE;
	}

	protected  Object getId() {
		return role.get_id();
	}


}
